/**
 * 
 */
package com.lunevich.json.tasks;

import java.util.List;

import android.content.Context;

import com.lunevich.json.handler.ApplicationXMLHandler;
import com.lunevich.json.helpers.XMLManager;

/**
 * @author Andrei_Lunevich
 *
 */
public abstract class XMLAsyncTask<T> extends CommonAsyncTask<T> {
	
	private Context context;
	
	public XMLAsyncTask(Context context) {
		this.context = context;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<T> onLoad(String url) throws Exception {
		ApplicationXMLHandler applcationXMLHandler = new XMLManager(context).getApplicationXMLHandler(url);
		List<T> applicationItems = (List<T>) applcationXMLHandler.getApplicationList();
		return applicationItems;
	}
}